Migrate Runtime to the Substrate version 2.0.0 rc4#1075
Conversation
# Conflicts: # Cargo.lock # runtime-modules/hiring/src/mock.rs # runtime-modules/recurring-reward/src/mock/mod.rs # runtime-modules/token-minting/src/mock.rs
mnaamani
left a comment
There was a problem hiding this comment.
So tremendous job doing this conversion.
I left a few questions really. No major change requests everything seems to be in order.
Build and tests all going well.
Out of curiosity I did try to do a cargo update and see if a build with latest dependencies works, but I did run into the libp2p build error.
substrate rc5 is out and it does bump version of libp2p, perhaps it will help.
| pub fn run_to_block(n: u64) { | ||
| while System::block_number() < n { | ||
| <System as OnFinalize<u64>>::on_finalize(System::block_number()); | ||
| <ContentWorkingGroup as OnFinalize<u64>>::on_finalize(System::block_number()); |
There was a problem hiding this comment.
should we also be doing this for other modules that are part of the this test runtime, like Balances and Minting?
|
|
||
| //TODO: Convert errors to the Substrate decl_error! macro. | ||
| /// Result with string error message. This exists for backward compatibility purpose. | ||
| pub type DispatchResult = Result<(), &'static str>; |
There was a problem hiding this comment.
This type alias is defined in each pallet lib.rs
Is there a particular reason you didn't just put it once in the common crate ?
There was a problem hiding this comment.
I think I understand now why you are keeping it local.
|
|
||
| pub type Extrinsic = TestXt<Call, ()>; | ||
|
|
||
| /* |
There was a problem hiding this comment.
Can this commented code be removed?
There was a problem hiding this comment.
Sure (conversion artifact).
| pub const IndexDeposit: Balance = 0; // no minimum deposit | ||
| } | ||
|
|
||
| impl pallet_indices::Trait for Runtime { |
There was a problem hiding this comment.
I've always chosen not to include the account indices module because of its behavior when the minimum existential deposit was configured to be zero. Basically it would allow re-use of an index for new accounts which can be undesirable and lead to some confusion on the part of users.
| #[test] | ||
| fn storage_provider_helper_succeeds() { | ||
| initial_test_ext().execute_with(|| { | ||
| // Bug in random module requires move the initial block number. |
There was a problem hiding this comment.
does the random module seed itself with some initial state from genesis or simply the block number? I imagine that is part of how it can be deterministic?
|
Part of this PR |
|
Thanks for taking time to answer my questions. |
Converted the runtime crate and all pallets.